﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;
using IService;
using DAL;

namespace Service
{
    public class OmPurchaseOrderService : IOmPurchaseOrderService
    {
        private OmPurchaseOrderDal _opod;
        public OmPurchaseOrderService(OmPurchaseOrderDal opod)
        {
            _opod = opod;
        }

        /// <summary>
        /// 新增进货订单
        /// </summary>
        /// <param name="opof"></param>
        /// <param name="opodf"></param>
        /// <param name="sadtoList"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task<int> AddOmpurchaseOrderInfo(OmPurchaseOrderForAdd opof, List<OmPurchaseOrderDetailForAdd> opodfList, List<SysAttachmentDTO> sadtoList)
        {
            return _opod.AddOmpurchaseOrderInfo(opof, opodfList, sadtoList);
        }

        /// <summary>
        /// 审核进货订单
        /// </summary>
        /// <param name="auditorBy"></param>
        /// <param name="auditorComment"></param>
        /// <param name="statu"></param>
        /// <param name="upOrderId"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task<int> AuditOmPurOrder(long auditorBy, string auditorComment, string statu, long upOrderId)
        {
            return _opod.AuditOmPurOrder(auditorBy, auditorComment, statu, upOrderId);
        }

        /// <summary>
        /// 非审核修改进货订单状态
        /// </summary>
        /// <param name="statu"></param>
        /// <param name="upOrderId"></param>
        /// <returns></returns>
        public Task<int> ChangeOmPurOrderStatu(string statu, long upOrderId,long updateBy)
        {
            return _opod.ChangeOmPurOrderStatu(statu, upOrderId,updateBy);
        }

        /// <summary>
        /// 查看进货订单详情信息
        /// </summary>
        /// <param name="upOrderId"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task<OmPurchaseOrderDTO> CheckOmPurOrderDetailInfo(long upOrderId)
        {
            return _opod.CheckOmPurOrderDetailInfo(upOrderId);
        }

        public Task<int> DeleteOmPurOrder(List<long> upOrderList, long updateBy)
        {
            return _opod.DeleteOmPurOrder(upOrderList, updateBy);
        }

        /// <summary>
        /// 获取全部商品信息用于新增进货订单
        /// </summary>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task<List<BiProductDTO>> GetAllGoodsInfoForAddGoods()
        {
            return _opod.GetAllGoodsInfoForAddGoods();
        }

        /// <summary>
        /// 全部进货订单查询
        /// </summary>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task<List<OmPurchaseOrderDTO>> GetAllOmPurchaseOrderAsync()
        {
            return _opod.GetAllOmPurchaseOrderAsync();
        }

        /// <summary>
        /// 查询组织架构信息用于下拉框
        /// </summary>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task<List<SysOrganizationDTO>> GetOrgInfoForSelectTable()
        {
            return _opod.GetOrgInfoForSelectTable();
        }

        /// <summary>
        /// 查询供应商信息用于下拉框
        /// </summary>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task<List<BiSupplierDTO>> GetSupplierInfoForSelectTable()
        {
            return _opod.GetAllSupplierInfoForSelectTable();
        }

        /// <summary>
        /// 查询用户信息用于下拉框
        /// </summary>
        /// <returns></returns>
        public Task<List<UsersDTO>> GetUserInfoForSelectTable()
        {
            return _opod.GetUsersInfoForSelectTable();
        }

        /// <summary>
        /// 多条件查询进货订单
        /// </summary>
        /// <param name="sopows"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task<List<OmPurchaseOrderDTO>> SearchOmPurOrderWithSmthFunc(SearchOmPurOrderWithSmth sopows)
        {
            return _opod.SearchOmPurOrderWithSmthFunc(sopows);
        }

        /// <summary>
        /// 根据upOrderId查询进货订单用于修改
        /// </summary>
        /// <param name="upOrderId"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task<List<OmPurchaseOrderForUpdate>> SelectOmPurchaseOrderByUpOrderId(long upOrderId)
        {
            return _opod.SelectOmPurchaseOrderByUpOrderId(upOrderId);
        }
    }
}
